{% extends "Acc_Reportform.html" %}
{% load i18n %}

{% block id_main_div_report %}
    {% if request.user|HasPerm:"contenttypes.can_AllEventReportPage" %}

    {% if request.user|HasPerm:"iaccess.browse_accrtmonitor" %}
    
    <div ><li id="id_model_export" style="display:none"><a class="action_Model_Export" href="javascript:void(0)" alt="export"></a></li></div>

    <div id="id_datalist" style="z-index:-1" class="div_box h280"><h1>{% trans "所有事件" %}</h1>
    </div>
    {% endif %}<!--browse_accrtmonitor-->
    {% endif %}<!--contenttypes.can_AllEventReportPage-->
{% endblock %}

{% block acc_reportform %}
    {% if request.user|HasPerm:"contenttypes.can_AllEventReportPage" %}
    {% if request.user|HasPerm:"iaccess.browse_accrtmonitor" %}
    $("#id_datalist").model_grid({
        "model_url": "{{ dbapp_url }}iaccess/AccRTMonitor/",
        "model_actions": true,
        "object_actions": false,
        "obj_edit": false,
        "record_per_page": 100,
        //"sort_fields": ["-time"],  
        "max_no_page": 100,            
        //"disable_cols": ['show_media|media_icon'],
        "disabled_actions": ["OpClearAbnormityLogs","_delete","_add","_clear","_change"],
        "multiple_select": null,
        "action_onclick_continue": false,
        "row_operations": [],
        "init_after_get_jdata": function(){
            $("#id_sys_cur_exporttitle").val('{% trans "全部门禁事件" %}'); 
            $("#id_datalist div.action").append('<li id="id_export"><a alt="export" href="javascript:void(0)" class="action_Model_Export">'+gettext("导出报表")+'</a></li>')
            $("#id_export").click(function(){
                $("#id_model_export").click();
            });    
            //自定义下拉框
            try
            {
                adjust_dropdown_list($("#search_id_event_type"));
            }
            catch(e)
            {
            }
        }

    });

        
    {% endif %}<!--browse_accrtmonitor-->
    {% else %}
        $("#id_search").remove();
        alert(gettext("对不起，您没有访问该页面的权限，不能浏览更多信息！"));
        window.location.href = "/{{ request.surl }}accounts/login/";
    {% endif %}<!--contenttypes.can_AllEventReportPage-->
{% endblock %}
